import { AddChannelType } from '@/store/reducer/channel';
import request from '@/utils/request';
//获取所有频道
export const getAllChannelApi = () => {
  return request({
    url: '/v1_0/channels',
  });
};
//获取用户频道
export const getUserChannelApi = () => {
  return request({
    url: '/v1_0/user/channels',
  });
};
//用户删除单个频道
export const delUserChannelApi = (id: number) => {
  return request({
    url: '/v1_0/user/channels/' + id,
    method: 'delete',
  });
};
//用户添加频道
export const addUserChannelApi = (data: AddChannelType) => {
  return request({
    url: '/v1_0/user/channels',
    method: 'patch',
    data,
  });
};
